package cn.iocoder.yudao.module.project.dal.mysql.productioncode;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.project.dal.dataobject.productioncode.ProductionCodeDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.project.controller.admin.productioncode.vo.*;

/**
 * 成品码信息 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface ProductionCodeMapper extends BaseMapperX<ProductionCodeDO> {

    default PageResult<ProductionCodeDO> selectPage(ProductionCodePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ProductionCodeDO>()
                .likeIfPresent(ProductionCodeDO::getName, reqVO.getName())
                .eqIfPresent(ProductionCodeDO::getOrderCode, reqVO.getOrderCode())
                .eqIfPresent(ProductionCodeDO::getType, reqVO.getType())
                .betweenIfPresent(ProductionCodeDO::getDownlineTime, reqVO.getDownlineTime())
                .eqIfPresent(ProductionCodeDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(ProductionCodeDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ProductionCodeDO::getId));
    }

    List<ProductRetrospectVO> selectProductRetrospect(Map<String, Object> params);
    Long countProductRetrospect(Map<String, Object> params);
    List<DefectiveProductVO> selectDefectiveProduct(Map<String, Object> params);
    Long countDefectiveProduct(Map<String, Object> params);
    List<MaterialBatchVO> selectMaterialBatch(Map<String, Object> params);
    Long countMaterialBatch(Map<String, Object> params);
    List<DefectiveProductVO> selectMaterialRigidity(Map<String, Object> params);
    Long countMaterialRigidity(Map<String, Object> params);
    List<MaterialReceiptVO> selectMaterialReceipt(Map<String, Object> params);
    Long countMaterialReceipt(Map<String, Object> params);
    List<MaterialDeliveryVO> selectMaterialDelivery(Map<String, Object> params);
    Long countMaterialDelivery(Map<String, Object> params);
    List<RealtimeProductVO> selectRealtimeProduct();
    StatisticsVO selectStatisticsNum(String queryDate);

    Integer selectProDuctNumByOrderCode(Map<String, Object> params);

    void updateProductionCodeKey(UpdatedProductionCodeVO updatedProductionCodeVO);
}
